/**
 * 2018年5月22日上午12:23:59
 */
package com.an.nopro.app;

import org.quartz.spi.TriggerFiredBundle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.scheduling.quartz.AdaptableJobFactory;
import org.springframework.stereotype.Component;

/**

 * @目的：.<br>
 * 
 * @author 86171
 * @date 2018年5月22日上午12:23:59
 * 
 */
@Component
public class MyFactoryBean extends AdaptableJobFactory {
	@Autowired
    private AutowireCapableBeanFactory capableBeanFactory;

    @Override
    protected Object createJobInstance(TriggerFiredBundle bundle) throws Exception {
        Object jobInstance = super.createJobInstance(bundle);
        capableBeanFactory.autowireBean(jobInstance);
        return jobInstance;
    }
}
